package com.shangyueshang.controller.supply;

import com.shangyueshang.request.InventoryDTO;
import com.shangyueshang.request.PageReq;
import com.shangyueshang.response.HttpResult;
import com.shangyueshang.response.PageResult;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: JokeyZheng
 * @email: zhengjingfeng@ruqimobility.com
 * @created: 2022/2/18 18:02
 * @version: v1.0.0
 */
@RestController
@RequestMapping("/inventory")
public class InventoryController {

    /**
     * 分页查询
     *
     * @param pageReq
     * @return
     */
    @PostMapping("/findPage")
    @PreAuthorize("hasAuthority('supply:inventory:view')")
    public HttpResult findPage(@RequestBody PageReq pageReq) {
        return HttpResult.ok(new PageResult());
    }

    /**
     * 保存
     *
     * @param request
     * @return
     */
    @PostMapping("/save")
    @PreAuthorize("hasAuthority('supply:inventory:add') and hasAuthority('supply:inventory:edit')")
    public HttpResult save(@RequestBody InventoryDTO request) {
        return null;
    }

}
